FROM centos

#安装JDK
ADD jdk1.8.0_191 /opt/java/

# 安装tomcat
ADD apache-tomcat-8.5.37 /usr/local/tomcat/

#设置环境变量
ENV JAVA_HOME /opt/java
ENV CATALINA_HOME /usr/local/tomcat/
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin

#打包项目并拷贝到tomcat webapps目录
RUN rm -rf /usr/local/tomcat/webapps/*

#开启内部服务端口
EXPOSE 8080

#启动tomcat服务器
CMD ["catalina.sh","run"]